import { Component } from 'react';

import { TabBar,Toast, Button } from 'saltui';

import './PageHome.less';

export default class PageHome extends Component {

  constructor(props) {
    super(props);
    this.state = {
      activeIndex : this.props.activeIndex
    };
    this.tabBarItems = [
      {
        title: '问卷管理',
        icon: <span className="iconfont icon-QAmanagement"></span>,
        path: '/star',
      },
      {
        title: '我的答卷',
        icon: <span style={{ fontSize:21}} className="iconfont icon-research t-ML4"></span>,
        path: '/a/star',
      }
      ,{
        title: '问卷统计',
        icon:<span className="iconfont icon-statistics1"></span>,
        path: '/a/star',
      }
    ];
  }

  render() {
    const t = this;
    const tabBarStyle = {};
    //底部tab页面跳转
    const onChange = (activeIndex)=>{
      if(activeIndex == 0 ){
        location.hash = 'questionnaire/home';
      }else if(activeIndex == 1){
        location.hash = 'questionnaire/my_ques';
      }else if(activeIndex == 2){
        location.hash = 'questionnaire/statis';
      }
    };
    return (
      <TabBar
        tabBarStyle={tabBarStyle}
        activeIndex={this.state.activeIndex}
        onChange={onChange}
        iconHeight={28}
        cIconHeight={55}
        items={this.tabBarItems}
      />
    );
  }
}

